package domd5;

public class test {
    public static void main(String[] args) {
        try{
            int[] num=null;  //这里发生的是空指针异常
            String[] str=new String[10];
            str[11]="hello";
        }catch (ArrayIndexOutOfBoundsException e) {//此处捕捉的是数组越界异常
            System.out.println("捕获了ArrayIndexOutOfBoundsException。。。异常");
            e.printStackTrace();
        }catch (NullPointerException e){
            System.out.println("捕获了NullPointerException。。");
            e.printStackTrace();
        }finally {
            System.out.println("finally...执行了");
        }
    }
}
